/**
 * 统一带状态下拉框, 其Store必须有status字段, 用于查看时将disabled的选项设置为灰色且不可选
 */
Ext.define('Emp.ux.form.field.ComboBoxStatus', {
	extend:'Ext.form.field.ComboBox',
    alias: 'widget.comboboxstatus',
	
	listConfig: {
		getInnerTpl: function() {
			return '<tpl if="status == \'enable\'"><div>{display}</div><tpl else><div class="disable-status" data-qtip="已停用">{display}</div></tpl>';
		},
		listeners: {
			itemclick: function(view, record) {
				if(record.get('status') === 'enable') {
					view.selModel.locked = false;
				} else {
					view.selModel.locked = true;
				}
			}
		}
    },
	
	initComponent: function() {
		this.callParent();
	}
})